#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar a[16]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
void main()
{
uint x,y,k;
while(1)
{

P2=0Xf0;
if(P2==0Xf0)
{
}
else
{
switch(P2)
    {
     case 0x70: x=0; break;
     case 0xb0: x=1; break;
     case 0xd0: x=2; break;
     case 0xe0: x=3; break;
    }
}
P2=0x0f;
{
switch(P2)
    {
     case 0x07: y=3; break;
     case 0x0b: y=2; break;
     case 0x0d: y=1; break;
     case 0x0e: y=0; break;
    }
}
k=4*x+y;
P1=0xfe;
P0=a[k];
} 
}